package com.nyist.test.service.impl;

import com.nyist.test.dao.AccountMapper;
import com.nyist.test.service.IAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class AccountService implements IAccountService {

    @Autowired
    AccountMapper accountMapper;

    @Transactional
    public void update() throws RuntimeException
    {
        accountMapper.update(1290,1);//用户1减10块 用户2加10块
        int i=1/0;
        accountMapper.update(2310,2);
    }

}
